This page last changed on Jan 02, 2007 by rosie@atlassian.com.

You need to edit in 'Wiki Markup' mode to include macros in your page.

The Blog Posts Macro allows you to display a space's news items within a page. Clicking on the title of the news item opens it up in a new window.

Blog Posts Macro

What you need to type What you will get
{blog-posts}


This is a sample news item for the Documentation Space.

Posted at 26 Aug @ 1:48 AM by Vidya Madabushi | 0 comments | Edit
Last changed: Aug 11, 2005 23:26 by Vidya Madabushi

Sample News

Posted at 08 Jul @ 12:48 PM by 강희철 | 2 comments | Edit

Optional Parameters

No  parameter Default Description
 1 no  15 Specify the number of posts you want displayed
 2 content excerpts Display the content in its entirety, as short excerpts, or as a list of titles
 3 time none Specify from how far back in time you want items displayed
 4 labels none To display content with specified labels

Optional Parameters

1. Specify the number of posts you want displayed

{blog-posts:1}

2. Display the content in its entirety, as short excerpts, or as a list of titles

Excerpts

{blog-posts:5|content=excerpts}

Titles

{blog-posts:5|content=titles}

3. Choose from how far back in time you want items displayed

For example, "time=12h" would display those items created in the last twelve hours, and "time=7d" would show items made in the last week. (The default is no limit)

Hours

{blog-posts:time=12h}

Days

{blog-posts:time=7d}

4. Filter items using labels

  • To display content with any of the specified labels

The following code will display items that contain either of the labels, 'atlassian' or 'confluence'

{blog-posts:labels=atlassian,confluence|}
  • To display content with all of the specified labels

The following code will display content with both labels 'atlassian' and 'confluence'

{blog-posts:labels=atlassian,confluence|match-labels=all}

5. Filter items using a user name

  • To display content associated to a particular user

The following code will display the first 10 items posted by a user.

{blog-posts:10|spaces=~username}

6. Filter items by combining parameters

The following code will display the first 10 items posted by a user from a particular space as a list.

{blog-posts:10|spaces=space name,~username|content=title}
RELATED TOPICS

Working with Macros
Working with News Overview

Take me back to Confluence 2 Home

Is there any way to constrain the formating of the display for this macro? It's pretty messy if you've got it in a list. The title, for example is huge.

Posted by doggy@doggy.com at Dec 26, 2005 12:43

Why I can't add this macro to page that is part of another page? I am getting error "Unable to render (blog-posts) Already included page...."? Everything works with contentbylabel macro... except that macro doesn't suit my need...

Posted by ajevic at Feb 06, 2006 06:22

Is there a way to display only the blog item titles without the table header?

 Also, it would be nice if you could choose the order and types of content displayed. For example you might setup the macro to handle this:
Title Author Date Posted
Sample News Vidya Madabushi Aug 26, 2005 01:48
Test News 강희철 Jul 08, 2005 12:48

Posted by dnagoda at Apr 07, 2006 12:13

Oops! Previous macro call wasn't escaped. Should have looked like this:
{blog-posts:content=user-defined| fields=date, title}

Posted by dnagoda at Apr 07, 2006 12:16

Here's a bug. When I use the macro like this...

{blog-posts:4|content=excerpts}

... I don't actually get the 4 most recent posts. The "most recent" post is actually from a couple of weeks ago. The other three are the most recent. What's up with that?

/carlos

Posted by carlosp at Jun 10, 2006 19:31

How do we limit the blogposts to a specific space or ask it to show news from all spaces?

Also, it seems to over-cache - delete a post from a space yet it still lingers in the blog-posts macro for ages...

Posted by gfraser at Jul 26, 2006 09:19

How can we style the blog-posts....change the css for the macro?

thnx,

steve

Posted by steves at Aug 15, 2006 11:06

Hi,

This macro doesnt appear to be working correctly- it doesnt update with the latest posts, and sometimes skips some old ones too. It is very random in this behaviour. Any ideas?

Posted by tom_crowder@hotmail.com at Aug 15, 2006 11:31

Thomas, that sounds like an unusual problem. Could you please raise a support request with some screenshots and details of your problem?

Posted by mryall at Aug 16, 2006 00:39

It's over-caching - we've noticed the same sort of thing and so have our clients, eg:

  • add a new post and it doesn't show up for an hour or so
  • delete a post and it's still shown

When the cache eventually clears down, it obviously shows the correct information, but while that cache is in place people get confused because the blog-posts macro is not accurately reflecting the actual blog posts.

Posted by gfraser at Aug 16, 2006 04:43

Hi,

I need to format the output of this macro for one space. I tried a if ($helper.spaceKey == <myspace>) to do the formatting in lastblogs.vm, however it does not seem to be able to get the $helper object. Anyone who knows how to get the spacekey from within the .vm file? (I did try the #set ($helper = params.get("helper")) as in page.vmd, but that did  not work

Posted by solfrid.hengebol@accenture.com at Sep 14, 2006 02:46

Is it possible to add a parameter to only show news from a specific user?

Posted by achambers@relic.com at Sep 27, 2006 11:38

Yes, I am updating this documentation now.

Posted by ivan@atlassian.com at Dec 05, 2006 22:47

I noticed that the HTML for the Title column's heading specifies width="70%" (Confluence 2.3). This is not appropriate when the Author and Date posted column values are about the same length as the title. Web browsers are perfectly good at table layout so I don't see the point of this.

Posted by peter.hilton at Jan 15, 2007 10:17

Feature request: New parameter for specifying start (and stop) times, so it will be possible to list the most recent posts with excerpts and the older ones with just titles:

h2. News the last 7 days
{blog-posts:15|time=7d|content=excerpts}

h3. News the last month (excluding the last 7 days which are listed above)
{blog-posts:15|starttime=7d|time=30d|content=excerpts}

http://jira.atlassian.com/browse/CONF-7672

Posted by cl@escenic.com at Jan 16, 2007 10:12

I'm finding the spaces=~username parameters isn't working. Is this also a caching issue, or is there are required version for this macro?

Posted by cbbarkin at Feb 02, 2007 16:14
Document generated by Confluence on Feb 05, 2007 23:34